#ifndef UTILS_H
#define UTILS_H
#include<random.hpp>
#include<QVector3D>
#include<aabb.h>
using Random = effolkronium::random_static ;
#define MY_PI 3.1415926
inline float ffmin(float a,float b){return a<b?a:b;}
inline float ffmax(float a,float b){return a>b?a:b;}
extern QVector3D random_in_unit_sphere();
extern QVector3D random_in_unit_disk();
extern QVector3D reflect(const QVector3D&v,const QVector3D&n);
extern bool refract(const QVector3D&v,const QVector3D&n,float ni_over_nt,QVector3D&refracted);
extern float schlick(float cosine,float ref_idx);
extern aabb surrounding_box(aabb box0,aabb box1);
extern void get_sphere_uv(const QVector3D&p,float&u,float&v);
#endif // UTILS_H
